from selenium.webdriver.common.by import By
from common.Utils import BlogDriver

class BlogDetail:
    url = ""
    driver = ""

    def __init__(self):
        self.url = "http://8.155.1.153:8081/survey/new?mode=survey"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)

    #登陆状态下博客详情页的测试
    def DetailTestByLogin(self):
        #检查标题
        self.driver.find_element(By.CSS_SELECTOR,"#editor > div.survey-sidebar-panel > div.survey-sidebar-panel-tabs > div.survey-sidebar-panel-tabs-pane.active")
        #检查题型
        self.driver.find_element(By.CSS_SELECTOR,"#rc-tabs-5-tab-1")
        #检查内容
        self.driver.find_element(By.CSS_SELECTOR,"#rc-tabs-5-panel-1 > div > div > dl:nth-child(1) > dt")
        #屏幕截图
        BlogDriver.getScreenShot()